package cn.shop.cloud.mapper;


import cn.shop.cloud.domain.OrderInfo;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @program: work
 * @ClassName OrderInfoMapper
 * @description:
 * @author: 李尧坤
 * @create: 2025−01-09 20:00
 * @Version 1.0
 **/
@Mapper
public interface OrderInfoMapper {
    @Insert("INSERT INTO t_order_info (order_no,user_id,good_id,good_img,delivery_addr_id,good_name,good_count,good_price,seckill_price,status,create_date,pay_date) VALUES \n" +
            "(#{orderNo},#{userId},#{goodId},#{goodImg},#{deliveryAddrId},#{goodName},#{goodCount},#{goodPrice},#{seckillPrice},#{status},#{createDate},null)")
    public  void insert(OrderInfo oi);

    @Select("SELECT * FROM t_order_info WHERE order_no=#{orderNo}")
    public OrderInfo find(String orderNo);

    @Select("SELECT status FROM t_order_info WHERE order_no=#{orderNo}")
    public int queryStatusByOrderNo(String orderNo);
}
